package cn.wolfcode.p2p.business.service.impl;

import cn.wolfcode.p2p.business.mapper.platformBankInfoMapper;
import cn.wolfcode.p2p.business.service.IplatformBankInfoService;

import cn.wolfcode.p2p.business.domain.platformBankInfo;
import java.util.List;
import cn.wolfcode.base.QueryObject;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class platformBankInfoServiceImpl implements IplatformBankInfoService {
    @Autowired
    private platformBankInfoMapper platformBankInfoMapper;
	
	@Transactional(readOnly=true)
	public PageInfo<platformBankInfo> query(QueryObject qo) {
		PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
		List<platformBankInfo> list = platformBankInfoMapper.selectList(qo);
		return new PageInfo<platformBankInfo>(list);
	}

	public void saveOrUpdate(platformBankInfo pb) {
		// 
		if (pb.getId() != null){
			platformBankInfoMapper.updateById(pb);
		}else {
			platformBankInfoMapper.insert(pb);
		}
	}	
}
